package com.ry.servcie;

import com.ry.pojo.Cats;
import com.ry.pojo.SearchItems;
import com.ry.pojo.SearchShops;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class TestSearchImpl implements TestSearch {
    @Override
    public List<Cats> getCats() {
        List<Cats> list = new ArrayList<>();
        list.add(new Cats(100,"测试1"));
        list.add(new Cats(200,"测试2"));
        list.add(new Cats(300,"测试3"));
        list.add(new Cats(400,"测试4"));
        list.add(new Cats(500,"测试5"));
        return list;
    }

    @Override
    public List<SearchItems> getSearchItems(Integer catId, String title) {
        List<SearchItems> list = new ArrayList<>();
        List<SearchItems> list1 = new ArrayList<>();
        list.add(new SearchItems(100l,"商品数据1","/images/banner.jpg",100,101010l,"/images/banner.jpg","shopname1"));
        list.add(new SearchItems(200l,"商品数据2","/images/banner.jpg",200,202020l,"/images/banner.jpg","shopname2"));
        list.add(new SearchItems(300l,"商品数据3","/images/banner.jpg",300,303030l,"/images/banner.jpg","shopname3"));

        list1.add(new SearchItems(400l,"商品数据4","/images/banner.jpg",400,404040l,"/images/banner.jpg","shopname4"));
        list1.add(new SearchItems(500l,"商品数据5","/images/banner.jpg",500,505050l,"/images/banner.jpg","shopname5"));
        list1.add(new SearchItems(600l,"商品数据6","/images/banner.jpg",500,606060l,"/images/banner.jpg","shopname6"));
        return title==null?list:list1;
    }

    @Override
    public List<SearchShops> getSearchShops(String shopName) {
        List<SearchShops> list = new ArrayList<>();
        list.add(new SearchShops(100L,"/images/banner.jpg","shopname1"));
        list.add(new SearchShops(200L,"/images/banner.jpg","shopname2"));
        list.add(new SearchShops(300L,"/images/banner.jpg","shopname3"));
        list.add(new SearchShops(400L,"/images/banner.jpg","shopname4"));
        list.add(new SearchShops(500L,"/images/banner.jpg","shopname5"));
        return list;
    }
}
